package club.jdiy.core.properties;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@SpringBootConfiguration
public class SpringAware {

    @Bean
    public JPAQueryFactory initJPAQueryFactory() {
        return new JPAQueryFactory(em);
    }

    @PersistenceContext
    protected EntityManager em;

}
